<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .father {
      display: table-cell;
      vertical-align: middle;
      text-align: center;
      width: 200px;
      height: 200px;
      border: 1px solid;
    }

    .son {
      background-color: salmon;
      display: inline-block;
    }
  </style>
</head>

<body>
  <div class="father">
    <div class="son">水平垂直居中</div>
  </div>
</body>

</html>